/* eslint-disable */
import { hiprint } from 'vue-plugin-hiprint'

// 自定义设计元素1
export const aProvider = function (formTop,tableTop,tablefilte) {
	var addElementTypes = function (context) {
		context.removePrintElementTypes("taskProviderModule");
		if(tablefilte){
			context.addPrintElementTypes(
				"taskProviderModule",
				[
					new hiprint.PrintElementTypeGroup("表头", [
						...formTop
					]),
					new hiprint.PrintElementTypeGroup("表体字段", [
						...tablefilte
					]),
					new hiprint.PrintElementTypeGroup("表格", [
						...tableTop
					]),
					new hiprint.PrintElementTypeGroup("辅助", [
						{
							tid: 'taskProviderModule.hline',
							title: '横线',
							type: 'hline'
						},
						{
							tid: 'taskProviderModule.vline',
							title: '竖线',
							type: 'vline'
						},
						{
							tid: 'taskProviderModule.rect',
							title: '矩形',
							type: 'rect'
						},
						{
							tid: 'taskProviderModule.oval',
							title: '椭圆',
							type: 'oval'
						}
					])
				]
			);
		}else{
			context.addPrintElementTypes(
				"taskProviderModule",
				[
					new hiprint.PrintElementTypeGroup("表头", [
						...formTop
					]),
					new hiprint.PrintElementTypeGroup("表体", [
						...tableTop
					]),
					new hiprint.PrintElementTypeGroup("辅助", [
						{
							tid: 'taskProviderModule.hline',
							title: '横线',
							type: 'hline'
						},
						{
							tid: 'taskProviderModule.vline',
							title: '竖线',
							type: 'vline'
						},
						{
							tid: 'taskProviderModule.rect',
							title: '矩形',
							type: 'rect'
						},
						{
							tid: 'taskProviderModule.oval',
							title: '椭圆',
							type: 'oval'
						}
					])
				]
			);
		}
		
	};
	return {
		addElementTypes: addElementTypes
	};
};
